<template>
  <div id="app">
    <!-- 面包屑区域 -->
    <el-card class="box-card">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item><a href="/">一级菜单</a></el-breadcrumb-item>
        <el-breadcrumb-item>二级菜单</el-breadcrumb-item>
        <el-breadcrumb-item>三级菜单</el-breadcrumb-item>
      </el-breadcrumb>
    </el-card>

    <el-card class="box-card">
      <el-row class="ssk1">
        <el-col :span="8"><div class="grid-content bg-purple" />
          <span class="spm">店铺名称：</span>
          <el-input v-model="search.input" placeholder="请输入内容" class="searchbox" />
        </el-col>
        <el-col :span="7"><div class="grid-content bg-purple-light" />
          <span>行业：</span>
          <el-select v-model="search.industry" placeholder="请选择" class="searchbox">
            <el-option
              v-for="item in industry"
              :key="item.id"
              :label="item.industry"
              :value="item.industry"
            />
          </el-select>
        </el-col>
        <el-col :span="9">
          <span>下单日期：</span>
          <el-date-picker
            v-model="search.value"
            type="daterange"
            align="right"
            unlink-panels
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            :picker-options="pickerOptions"
          />
        </el-col>
      </el-row>
      <el-row :gutter="10" class="line">
        <el-button class="thequery">查询</el-button>
        <el-button type="primary" class="thequery">重置</el-button>
      </el-row>
      <el-row :gutter="10" class="line">
        <el-button type="primary" class="statistical">统计分析</el-button>
      </el-row>

      <!-- 表格部分 -->
      <el-table
        :data="tableData"
        tooltip-effect="dark"
        style="width: 100%"
      >
        <el-table-column
          type="selection"
          width="55"
        />
        <el-table-column
          prop="id"
          label="商户ID"
          width="120"
        />
        <el-table-column
          prop="merchantname"
          label="商户名称"
        />
        <el-table-column
          prop="industry"
          label="行业"
        />
        <el-table-column
          prop="quantity"
          label="订单总数量"
        />
        <el-table-column
          prop="refund"
          label="退款/售后单"
        />
        <el-table-column
          prop="aftersalesprobability"
          label="售后率"
        />
        <el-table-column
          prop="refundamount"
          sortable
          label="确认退款数"
        />
        <el-table-column
          prop="Confirmrefundrate"
          label="确认退款率"
        />
      </el-table>
      <!-- 分页 -->
      <el-row class="line">
        <el-col :span="10">
          <span>共{{ total }}条记录 第{{ qureInfo._page }}/{{ total/qureInfo._limit }}页</span>

        </el-col>
        <el-col :span="14">
          <el-pagination
            background
            :current-page="qureInfo._page"
            :page-sizes="[1, 2, 5, 7]"
            :page-size="qureInfo._limit"
            layout="  prev, pager, next,sizes, jumper"
            :total="total"
          />
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>
<script>
export default {
  data() {
    return {
      // 行业列表数据
      industry: [
        {
          id: 1,
          industry: '餐饮业',
        },
        {
          id: 2,
          industry: '服装业',
        },
      ],
      // 日期选择数据
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
            picker.$emit('pick', [start, end]);
          },
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
            picker.$emit('pick', [start, end]);
          },
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
            picker.$emit('pick', [start, end]);
          },
        }],
      },
      // 表格数据
      tableData: [{
        id: 1, // id
        merchantname: '楼下小卖部', // 商户名称
        industry: '副食', // 行业
        quantity: '999', // 订单总数量
        refund: '999', // 退款/售后单
        aftersalesprobability: '99%', // 售后率
        refundamount: '123456', // 确认退款数
        Confirmrefundrate: '99%', // 确认退款率
      }, {
        id: 2, // id
        merchantname: '楼下小卖部', // 商户名称
        industry: '副食', // 行业
        quantity: '999', // 订单总数量
        refund: '999', // 退款/售后单
        aftersalesprobability: '99%', // 售后率
        refundamount: '234567', // 确认退款数
        Confirmrefundrate: '99%', // 确认退款率
      }],
      // 搜索框数据
      search: {
        input: '', // 输入框
        industry: '', // 行业
        value: '', // 所选时间
      },
      // 分页数据
      qureInfo: {
        _page: 1, // 当前页码值
        _limit: 5, // 每页显示条数
      },
      total: 10, // 总条数
    };
  },
};
</script>

<style>
#app{
  min-width: 1200px;
}
.searchbox{
  width: 250px;
}
.thequery{
  float: right;
  margin-right: 30px;
}
.line{
  margin-top: 15px;
}
.statistical{
  height: 30px;
  padding: 5px 12px;
}
</style>
